package y2017.date0226pm.颜色表注释调整;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MoveServer {
    private MoveServer() {
    }

    public static MoveServer getServer() {
        return new MoveServer();
    }

    public String moveString(String content) {
        StringBuilder newStr = new StringBuilder();
        String regex = "(<color.*color>)(<!.*>)";

        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(content);
        while (m.find()) {
            newStr.append(m.group(2) + "\n");
            newStr.append(m.group(1) + "\n");
        }

        return newStr.toString();
    }
}
